package cn.stylefeng.guns.modular.basic.mapper;

import cn.stylefeng.guns.modular.basic.entity.BasicGoods;
import cn.stylefeng.guns.modular.basic.model.params.BasicGoodsParam;
import cn.stylefeng.guns.modular.basic.model.result.BasicGoodsResult;
import cn.stylefeng.guns.modular.replenishment.model.result.BHStorageStockResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 商品表 Mapper 接口
 * </p>
 *
 * @author hu
 * @since 2019-06-28
 */
public interface BasicGoodsMapper extends BaseMapper<BasicGoods> {

    /**
     * 获取列表
     *
     * @author hu
     * @Date 2019-06-28
     */
    List<BasicGoodsResult> customList(@Param("paramCondition") BasicGoodsParam paramCondition);

    /**
     * 获取map列表
     *
     * @author hu
     * @Date 2019-06-28
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") BasicGoodsParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author hu
     * @Date 2019-06-28
     */
    Page<BasicGoodsResult> customPageList(@Param("page") Page page, @Param("paramCondition") BasicGoodsParam paramCondition, @Param("condition") String condition
    		, @Param("deptId") Long deptId,@Param("operateId") Long operateId);

    /**
     * 获取分页map列表
     *
     * @author hu
     * @Date 2019-06-28
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") BasicGoodsParam paramCondition);


    List<BasicGoodsResult> findListBySpec(@Param("paramCondition")BasicGoodsParam basicGoodsParam, @Param("operateId")Long operateId);

	BasicGoodsResult findBySpec(@Param("paramCondition")BasicGoodsParam param,@Param("operateId")Long operateId);

	boolean saveBatchList(@Param("list")List<BasicGoodsParam> list);

	List<BasicGoodsResult> findListBySpecNew(@Param("paramCondition")BasicGoodsParam basicGoodsParam, @Param("deptId")Long deptId, @Param("condition")String condition
			,@Param("operateId")Long operateId);

	Integer addReturnId(@Param("paramCondition")BasicGoodsParam param);

	void updateBySpec(@Param("paramCondition")BasicGoodsParam param);

	List<BasicGoodsResult> findListBySpecSd(@Param("paramCondition")BasicGoodsParam basicGoodsParam);

    List<BHStorageStockResult> findStorageStockByGoodsNumber(@Param("positionType") String positionType, @Param("goodsNumber") String goodsNumber, @Param("deptId")  long deptId);

    BHStorageStockResult findStorageStockByGoodsNumberNew(@Param("positionType") String positionType, @Param("goodsNumber") String goodsNumber, @Param("deptId")  long deptId);
}
